package com.lucy.nepu.module.paper.utils;

import cn.dev33.satoken.stp.StpUtil;
import com.lucy.nepu.module.paper.params.PaperCreateParams;

/**
 * @author kindear
 * 论文相关工具
 */
public class PaperUtil {
    public static String formValid(PaperCreateParams params){
        // 表单重复性校验
        String errMsg = "";
        Long operator = StpUtil.getLoginIdAsLong();
        Long applyId = params.getSecondAuthorId();
        if (!params.getFirstAuthorId().equals(0L)) {
            applyId = params.getFirstAuthorId();
        }
        if (!applyId.equals(operator)){
            errMsg = "您不是负责人，无法申报该项目";
            return errMsg;
        }
        return errMsg;
    }
}
